package babogd.demo.saml.mysaml.controller;

import org.apache.http.HttpResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/app")
public class AppController {

    @RequestMapping("/appstart")
    public void start(HttpServletResponse resp) throws Exception {
        resp.setContentType("text/html");
        resp.getWriter().append("<h1>You are now at the requested resource</h1>");
        resp.getWriter().append("This is the protected resource. You are authenticated");
    }

    @RequestMapping("/appstart2")
    public void appstart2(HttpServletResponse resp) throws Exception {
        resp.setContentType("text/html");
        resp.getWriter().append("<h1>I'm 2 </h1><br/><h2> You are now at the requested resource</h2>");
        resp.getWriter().append("This is the protected resource. You are authenticated");
    }

    @RequestMapping("/appstart3")
    public void appstart3(HttpServletResponse resp) throws Exception {
        resp.setContentType("text/html");
        resp.getWriter().append("<h1>I'm 3 </h1><br/><h2 You are now at the requested resource</h2>");
        resp.getWriter().append("This is the protected resource. You are authenticated");
    }
}
